home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / CShell⁄THINK C / CShell.make < prev    next >
Encoding:
Text File  |  1991-02-20  |  9.3 KB  |  230 lines  |  [TEXT/MPS ]

  1. #------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Sample Application
  6. #
  7. #    Program:    CShell
  8. #    File:        CShell.make    -    Make Source
  9. #
  10. #    Copyright © 1988-1991 Apple Computer, Inc.
  11. #    All rights reserved.
  12. #
  13. #------------------------------------------------------------------------------
  14.  
  15. AppName            =    'CShell'
  16. Signature        =    'CSHL'
  17.  
  18. #------------------------------------------------------------------------------
  19. # Location of our utility files. The double “:” means “one level above the
  20. # current folder”. Hopefully, this will also be the location of our
  21. # utilities folder. If not, then change the following line:
  22. #------------------------------------------------------------------------------
  23.  
  24. UtilityFolder    =    ":DTS.Utilities:"
  25. src                =    :
  26. obj                =     :OBJECT:
  27.  
  28. #------------------------------------------------------------------------------
  29. # Options for our compilers:
  30. #    -sym on: tells the compilers and linker to emit symbol information for
  31. #        a source level debugger, such as SADE.
  32. #    -i {UtilityFolder}: means to look for any #include files in the specified
  33. #        directory, as well as the normal set.
  34. #    -r: tells the C compiler to require function prototypes.
  35. #    -mbg off: tells the compilers to not emit low-level debugger names. This
  36. #        saves on file space, but you may wish to remove this option if you
  37. #        need to debug with something like Macsbug.
  38. #    -rd: for Rez means to suppress warnings for redeclared types (we redeclare
  39. #        'RECT' because it’s not included in MPW 3.0).
  40. #    -append: means to add the resources to the target file, rather than
  41. #        deleting all the ones that are there first.
  42. #    -d Signature...: is a way of passing our application's signature to Rez.
  43. #        With this mechanism, we can define our signature here, and export
  44. #        it to Rez, so that we don't have to declare it there, too.
  45. #    -sn STDCLIB=Main: puts all the routines that would normally go into the
  46. #        STDCLIB segment into the Main segment. This is done so that when we
  47. #        call upon any low-level utilities, we don't potentially move memory
  48. #        by loading in a segment.
  49. #------------------------------------------------------------------------------
  50.  
  51. SymOptions        =    #-sym on                    # turn this on to debug with SADE
  52. IncludesFolders    =    -i {UtilityFolder}
  53.  
  54. COptions        =    {IncludesFolders} {SymOptions} -r -mbg on
  55. RezOptions        =    {IncludesFolders} -rd -append -d Signature="{Signature}" -d AppName='"CShell"'
  56. LinkOptions        =    {SymOptions} {SegmentMappings} -msg nodup
  57. SegmentMappings    =    -sn INTENV=Main ∂
  58.                     -sn PASLIB=Main ∂
  59.                     -sn STDCLIB=Main ∂
  60.                     -sn SANELIB=Main ∂
  61.                     -sn UtilMain=Main ∂
  62.                     -sn MAFailureRes=Main ∂
  63.                     -sn Offscreen=Main ∂
  64.                     -sn UtilInit=Initialization
  65.  
  66. #------------------------------------------------------------------------------
  67. # These are modified default build rules.  This is necessary to take into
  68. # account differences between MPW 3.1 and 3.2
  69. #------------------------------------------------------------------------------
  70. {obj}            ƒ    {src}
  71.  
  72. {obj}.p.o        ƒ    {src}.p
  73.     {Pascal} {POptions} {PAltOptions} {DepDir}{Default}.p -o {TargDir}{Default}.p.o
  74.  
  75. {obj}.c.o        ƒ    {src}.c
  76.     {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  77.  
  78. #------------------------------------------------------------------------------
  79. # These are the objects that we want to link with. If any one of these
  80. # changes, then we invoke the Link command.
  81. #------------------------------------------------------------------------------
  82. AppObjects        =    ∂
  83.                     {UtilityFolder}Utilities.c.o ∂
  84.                     {obj}start.c.o ∂
  85.                     {obj}appleevents.c.o ∂
  86.                     {obj}appleevents2.c.o ∂
  87.                     {obj}docursor.c.o ∂
  88.                     {obj}doevent.c.o ∂
  89.                     {obj}eventloop.c.o ∂
  90.                     {obj}file.c.o ∂
  91.                     {obj}file2.c.o ∂
  92.                     {obj}help.c.o ∂
  93.                     {obj}idletasks.c.o ∂
  94.                     {obj}init.c.o ∂
  95.                     {obj}menu.c.o ∂
  96.                     {obj}print.c.o ∂
  97.                     {obj}texteditcontrol.a.o ∂
  98.                     {obj}texteditcontrol.c.o ∂
  99.                     {obj}utils.c.o ∂
  100.                     {obj}window.c.o ∂
  101.                     {obj}window2.c.o
  102.  
  103. #------------------------------------------------------------------------------
  104. # These help define the libraries that we want to link with. {AppObjects} holds
  105. # the names of the application units we want to link together. {CLibs} holds
  106. # the libraries we want to link with under MPW 3.0 or MPW 3.1. Under MPW 3.2
  107. # and later, “CInterface.o” and “CRuntime.o” are merged with “Interface.o” and
  108. # “Runtime.o”. So, under 3.2 and later, we link with the files in {CLibs32}
  109. # instead.
  110. #------------------------------------------------------------------------------
  111. PLibs            =    ∂
  112.                     "{Libraries}Runtime.o" ∂
  113.                     {UtilityFolder}GestaltGlue.a.o ∂
  114.                     "{Libraries}Interface.o" ∂
  115.                     "{PLibraries}PasLib.o"
  116.  
  117. PLibs32            =    ∂
  118.                     "{Libraries}Runtime.o" ∂
  119.                     "{Libraries}Interface.o" ∂
  120.                     "{PLibraries}PasLib.o"
  121.  
  122. CLibs            =    ∂
  123.                     "{CLibraries}CRuntime.o" ∂
  124.                     "{CLibraries}CInterface.o" ∂
  125.                     {UtilityFolder}GestaltGlue.a.o ∂
  126. #                    "{CLibraries}StdCLib.o" ∂
  127.                     "{Libraries}Interface.o"
  128.  
  129. CLibs32            =    ∂
  130.                     "{Libraries}Runtime.o" ∂
  131. #                    "{CLibraries}StdCLib.o" ∂
  132.                     "{Libraries}Interface.o"
  133.  
  134. #------------------------------------------------------------------------------
  135. # Generic Utilities dependencies - This standard set is pasted in whenever
  136. # we make use of the Utilities routines. It's quite probable that we don't
  137. # need all of these dependencies for this build, but any extra ones are
  138. # ignored.
  139. #------------------------------------------------------------------------------
  140.  
  141. UtilityRezFiles            =    {UtilityFolder}Utilities.r ∂
  142.                             {UtilityFolder}UtilitiesCommon.h
  143.                         
  144. UtilityHeaderFiles        =    {UtilityFolder}Utilities.h ∂
  145.                             {UtilityFolder}UtilitiesCommon.h
  146.  
  147. UtilityInterfaceFiles    =    {UtilityFolder}Utilities.p
  148.  
  149. {UtilityFolder}Utilities.p.o    ƒ    {UtilityFolder}Utilities.inc1.p
  150.  
  151. {UtilityFolder}Utilities.c.o    ƒ    {UtilityFolder}Utilities.h ∂
  152.                                     {UtilityFolder}UtilitiesCommon.h
  153.  
  154. #------------------------------------------------------------------------------
  155. # Dependencies for the individual components. These will invoke the
  156. # default build rules listed in Chapter 9 of the MPW 3.0 manual.
  157. # You may wish to reduce the number of dependencies.  Two dependencies
  158. # you may wish to remove are this makefile and the CShell.protos file.
  159. # For the CShell.protos file, if you add a function to the list of
  160. # functions in CShell.protos, you will cause all the source files to be
  161. # recompiled.  This may be more than you want to wait for each time you
  162. # add a function to your application.  On the other hand, if you do not
  163. # include this in the dependencies, and you change the parameters for a
  164. # function, and make the respective change to CShell.protos, any files
  165. # that reference that function will not be recompiled.  If these files are
  166. # recompiled, the prototype checking will catch any cases where you did
  167. # not change the way the altered function was called.  <<You choose>>
  168. #------------------------------------------------------------------------------
  169.  
  170. {AppObjects}    ƒ    #{AppName}.make ∂
  171. #                    CShell.h ∂
  172. #                    CShell.protos ∂
  173.                     {UtilityFolder}Utilities.c ∂
  174.                     {UtilityHeaderFiles}
  175.  
  176. #------------------------------------------------------------------------------
  177. # This is a dummy dependency rule.  This will always be executed.  This dummy
  178. # rule must be the first for {AppName} so that it will be executed first.
  179. # This is necessary to make evaluations that are beyond the scope of
  180. # Make.  These evaluations will be performed by the CShell at execution time,
  181. # and they must execute first because compile and link command lines depend
  182. # on variables set up by these evaluations.  This has the unfortunate side
  183. # effect that Make will always consider {AppName} to be out of date.  It will
  184. # always, at a minimum, execute the commands for the target ShellForce.
  185. #------------------------------------------------------------------------------
  186.  
  187. {AppName}            ƒƒ ShellForce
  188.  
  189. # With the above rule, {AppName} will always be out of date with respect to
  190. # the non-existent file ShellForce.  This will force the following commands to
  191. # be executed.
  192. ShellForce            ƒ
  193.     BEGIN
  194.         IF "{ShellVersion}" == ""
  195.             ( EVALUATE "`Version`" =~ /MPW Shell≈ ([0-9]+(.[ab0-9]+)+)®1≈/ ) ∑ Dev:Null
  196.             SET ShellVersion "{®1}"
  197.         END
  198.         IF "{ShellVersion}" =~ /3.[01]≈/
  199.             SET PAltOptions "-d MPW32=FALSE"
  200.             SET CAltOptions "-d MPW31"
  201.             SET PSysObjects "`QUOTE {PLibs}`"
  202.             SET CSysObjects "`QUOTE {CLibs}`"
  203.         ELSE
  204.             SET PAltOptions "-d MPW32=TRUE"
  205.             SET CAltOptions "-d MPW32"
  206.             SET PSysObjects "`QUOTE {PLibs32}`"
  207.             SET CSysObjects "`QUOTE {CLibs32}`"
  208.         END
  209.     END ∑ Dev:Null # Output to bit bucket so we don’t see above calculations
  210.  
  211. #------------------------------------------------------------------------------
  212. # Build rule that links our application together. If any of our objects 
  213. # changes, or this makefile changes, then we relink.  The dummy prerequisite
  214. # ShellForce must come before any other prerequisites for {AppName}
  215. #------------------------------------------------------------------------------
  216.  
  217. {AppName}            ƒƒ {AppObjects}
  218.     Link {LinkOptions} -o {Targ} {AppObjects} {CSysObjects}
  219.     SetFile {Targ} -t APPL -c {Signature} -a B
  220.  
  221. #------------------------------------------------------------------------------
  222. # Build rule that creates our resources and adds them to the application
  223. #------------------------------------------------------------------------------
  224.  
  225. {AppName}        ƒƒ    {AppName}.make ∂
  226.                     CShell.r ∂
  227.                     CShell.h ∂
  228.                     {UtilityRezFiles}
  229.     Rez {RezOptions} CShell.r -o {Targ}
  230.